
<%@ page import="feedbox.Opinion" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'opinion.label', default: 'Opinion')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
        <style type="text/css">
			.nav a {
				border: 1px solid gray;
				padding: 2px;
			}
			.nav a:hover {
				text-decoration: overline;
			}
		</style>
		<script type="text/javascript" src="${resource(dir:'js',file:'enum.js')}"></script>
		<script type="text/javascript" src="${resource(dir:'js',file:'jquery-1.7.js')}"> </script>
    </head>
    <body>
    <div class="nav">	
	<a href="../">Controladores</a>
	<a href="../opinion/list">Opniões</a>
	</div>
        <div class="nav">
                	<g:form name="SearchForm" method="GET" action="search" controller="opinion">
        		
        		<select id="field" name="field">

        			<option value="nota">Nota</option>
        			<option value="page"/>Página</option>
        			<option value="quesito+"/>Quesito +</option>
        			<option value="quesito-"/>Quesito -</option>
        		</select>
        		<input type="text" name="q"  onKeypress="return SomenteNumero(event, jQuery('#field').val())"/>
        		<input type="submit" value="Do it!"/>
        
        	</g:form>

        
        </div>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="id" title="${message(code: 'opinion.id.label', default: 'Id')}" />
                        
                            <g:sortableColumn property="nota" title="${message(code: 'opinion.nota.label', default: 'Nota')}" />
                        
                            <g:sortableColumn property="ip" title="${message(code: 'opinion.ip.label', default: 'Ip')}" />
                        
                            <g:sortableColumn property="page" title="${message(code: 'opinion.page.label', default: 'Page')}" />
                        
                        	<th><g:message code="opinion.meGusta.label" default="Quesito +" /></th>
                        
                            <th><g:message code="opinion.meGusta.label" default="Comentários" /></th>
                        
                        	<th><g:message code="opinion.noMeGusta.label" default="Quesito -" /></th>
                        
                            <th><g:message code="opinion.noMeGusta.label" default="Comentários" /></th>
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${resultset}" status="i" var="opinionInstance">
                        <tr class="${(i % 2) == 0 ? 'odd' : 'even'}">
                        
                            <td><g:link action="show" id="${opinionInstance.id}">${fieldValue(bean: opinionInstance, field: "id")}</g:link></td>
                        
                            <td>${fieldValue(bean: opinionInstance, field: "nota")}</td>
                        
                            <td>${fieldValue(bean: opinionInstance, field: "ip")}</td>
                        
                            <td>${fieldValue(bean: opinionInstance, field: "page")}</td>
                        
                            <td>${fieldValue(bean: opinionInstance, field: "meGusta.subject")}</td>
                        
                        	<td>${fieldValue(bean: opinionInstance, field: "meGusta.comment")}</td>
                        
                            <td>${fieldValue(bean: opinionInstance, field: "noMeGusta.subject")}</td>
                            
                            <td>${fieldValue(bean: opinionInstance, field: "noMeGusta.comment")}</td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
                
            </div>

            <div class="paginateButtons">
            	<g:paginate controller="opinion" action="search" total="${resultset.totalCount}" params="${['q': q, 'field': field]}"/>
            </div>
        </div>
    </body>
</html>
